﻿@model CooWork.Models.Account

@{
    ViewBag.Title = "usera";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script type="text/javascript" >
    $(function () {
        $("#Role").val("普通员工");
    });

</script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>添加用户</legend>      

        <div class="editor-label">
            @Html.LabelFor(model => model.UserName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>
        
        
        <div class="editor-label">
           @Html.LabelFor(model => model.ActualName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ActualName)
            @Html.ValidationMessageFor(model => model.ActualName)
        </div>


        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>




        <div class="editor-label">
              @Html.LabelFor(model => model.DepartmentId)
        </div>
        <div class="editor-field">
             @Html.Action("_department", "Data", new { id = "DepartmentId", name = "DepartmentId" })
        </div>


        <div class="editor-label">
              @Html.LabelFor(model => model.Role)
        </div>
        <div class="editor-field">
            @Html.Action("ddlroles", "Data", new { id = "Role", name = "Role" })
        </div>



     
       
    </fieldset>
    
    
  <fieldset class="plain-form">
    <legend>说明</legend>

<label for="user_show_important_announcements" style="padding-left: 5px; width: 350px;">
    一个部门只能设置一个负责人<br />
  
  <p>  可以通过设置部门领导这个角色，来给本部门，除主管以为的人，开通绝大多数主管的权限。
  （需要处理事情比较多时，主管一般都会配个助理来管理日常事务，此角色比较适用）；
   另外部门领导角色，可以创建跨部门任务，更好地进行协作与沟通。
   </p>

    
</label>
</fieldset>
    
    
    <fieldset class="plain-form">
    <legend>用户密码</legend>

    <table>
    <tbody>
    <tr>
    <td>
        
        <input type="checkbox" id="generate_password"  />
    </td>
    <td><label style="width: 200px;" for="generate_password">自动生成密码</label></td>
    </tr>
    </tbody>
    </table>
         <div class="editor-label">
            @Html.LabelFor(model => model.Password)
        </div>
            <div class="editor-field">
            @Html.EditorFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>
  <br />
    <p>创建完账号后，系统会自动发送对应账号密码到用户邮箱</p>
</fieldset>
    
    
     <p>
            <input type="submit" value="创建" />
        </p>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
